// 服务端启动webpack服务
let express = require('express');

let path = require('path');

let webpack = require('webpack');

let middle = require('webpack-dev-middleware');

let app = express();

let config = require(path.resolve(__dirname,'webpack.config.js'));

let compiler = webpack(config);

app.use(middle(compiler));

app.get('/user', function(req,res){
  res.send({name: 'ldx'})
})

app.listen(3000);